
//Header for Player
#ifndef _P_PLAYER_H
#define _P_PLAYER_H


#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

#include "objects.h"
#include "particle_factory.h"
#include "explosions.h"



enum death_types 
{
     D_NONE,
     D_GIBBED,
     D_IMPALED,
     D_EXPLOADED,
	 D_HEADSHOT,
	 D_NORMAL
};




enum player_states 
{
	 PL_NONE,
     PL_GROUND,
     PL_DEAD,
     PL_AIR
};

enum player_actions
{
	PA_NONE,
	PA_STANDING,
	PA_WALKING,
	PA_SHOOTING,
	PA_CROUCHING,
	PA_JUMPING
};
     



class Exhaust: Particle_Factory
{
public:
	void Update_Logic() {}
};

     
class Player: public Objects
{   
      
  public:    
	  	 Player();
         
		 void Draw();
        // void Draw_Weapon();                         
         void Input_Check();
         void Mechanics_Update();
		 bool Spawn( );
         void Kill( death_types type );
		 void Reset();
		 void Change_Weapon(int weapon_num);
		 int  Get_SelectedWeapon() { return selected_weapon; }
    
         bool Load_Character( std::string );

		 int Get_Action();
		 void Set_Action(int A);

		 //Set/Get visablity
		 void Set_Visability(bool v) { isVisable = v; }
		 bool Get_Visability() { return isVisable; }



		 sf::Vector2f Get_ShoulderPoint() { return current_sp; }
		 void Set_ShoulderPoint(sf::Vector2f new_shoulder_point) { current_sp = new_shoulder_point; }


		 Animation_Frames standFrames;
         



		 //Im cheating...
		 sf::Vector2f shoulder_point, current_sp;


		  //Sound stuff
		 sf::SoundBuffer SB_footstepHardwood;
		 sf::Sound SND_footstepHardwood;

  protected:         
         
          
		 void Map_Collision();
		 void Spawn_Exhaust(float, float);
		 void Spawn_Exhaust(sf::Vector2f pos);

		 //utility function to rotate weapon point with ship
		 void Rotate_WeaponPoint();


         //Animation bussiness   
         void Animation_Update(); 

		 Animation_Frames walkFrames;	
		 Animation_Frames jumpFrames;
		 int step_frame[2];
    


		 int selected_weapon;
  
		 
		


		 int Action;

		// float run_speed, walk_speed;
		 float rotation_speed;
		 float fast_rotation_speed;
		 float slow_rotation_speed;


		 bool isVisable;


		 float death_timer;
		 
		 //Map starting point
		 sf::Vector2f start_pos;
		

		 //Particles
		 Explosion_Factory deathExplosion;
		 Particle_Factory exhaustParticles;

		 //Sounds
		 sf::SoundBuffer *death_buf;
		 sf::Sound death_snd;
		
		 //player_states state;
         death_types   death_by;
};

extern Player player;


#endif
























































































//This Game was made by Julian Williams, srsly






















































































//This Game was made by Julian Williams, srsly
